home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / tctutor2.zip / CHAROUT.C < prev    next >
C/C++ Source or Header  |  1987-07-04  |  519b  |  19 lines

  1.                                          /* Chapter 10 - Program 2 */
  2. #include "stdio.h"
  3. main()
  4. {
  5. FILE *point;
  6. char others[35];
  7. int indexer,count;
  8.  
  9.    strcpy(others,"Additional lines.");
  10.    point = fopen("tenlines.txt","a"); /* open for appending */
  11.  
  12.    for (count = 1;count <= 10;count++) {
  13.       for (indexer = 0;others[indexer];indexer++)
  14.          putc(others[indexer],point);  /* output a single character */
  15.       putc('\n',point);                /* output a linefeed */
  16.    }
  17.    fclose(point);
  18. }
  19.